function pickerok(){$().pickerok();}
function pickercancel(){$().pickercancel();}
$(document).ready(function(){
var savedate;
$.fn.pickerok = function(){
	$('#inputDate').DatePickerHide();
	$(document).unbind('mousedown');	
}

$.fn.pickercancel = function(){
	$('#inputDate').DatePickerHide();
	$('#inputDate').val(savedate);
}

$('#inputDate').DatePicker({
	format:'Y-m-d',
        errDealMode:1,
	date: $('#inputDate').val(),
	current: $('#inputDate').val(),
	starts: 1,
	position: 'left',
	calendars: 2,
	mode: 'range',
	onBeforeShow: function(){
			$('#inputDate').DatePickerSetDate($('#inputDate').val(), true);
			savedate = $('#inputDate').val();
	},
	onHide:function(){
	},
	onChange: function(formated, dates){
		var formated = String(formated).replace(",","至");
		$('#inputDate').val(formated);
		if ($('#closeOnSelect input').attr('checked')) {
			$('#inputDate').DatePickerHide();
		}
	}
});
});


